﻿using System;
using System.Collections.Generic;

namespace SAE_Jam
{
    static class CollisionDetection
    {
        private static List<BoxCollider> boxColliders = new List<BoxCollider>();

        public static void AddBoxCollider(BoxCollider boxCollider)
        {
            boxColliders.Add(boxCollider);
        }

        public static void Update()
        {
            CheckBoxCollision();
        }

        private static void CheckBoxCollision()
        {
            foreach (var boxColliderA in boxColliders)
            {
                foreach (var boxColliderB in boxColliders)
                {
                    if (!boxColliderA.Equals(boxColliderB))
                    {
                        boxColliderA.CheckCollision(boxColliderB);
                    }
                }
            }
        }
    }
}
